<template>
  <div class="setup_Actions">
    <button @click="addTWO(2)">+2</button>
    <button @click="incrementAction1(2)">-2</button>
    <button @click="act1(9)">+9</button>
    <button @click="inct1(9)">-9</button>
  </div>
</template>
<script>
import { onMounted } from 'vue'
import { mapActions, useStore } from 'vuex'
export default {
  setup () {
    const store = useStore()
    const actions = mapActions(['addTWO', 'incrementAction1'])
    const actions1 = mapActions({
      act1: 'addTWO',
      inct1: 'incrementAction1'
    })
    onMounted(() => {
      // 请求成功后的执行函数
      const promise = store.dispatch('getBanner')
      promise.then(res => {
        console.log('res===', res)
      })
    })
    return {
      ...actions,
      ...actions1
    }
  }
}
</script>
<style scoped>

</style>
